<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 微信菜单
 */
class CreateWechatMenu extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wechat_menu', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('pid')->default(0)->comment('父类ID');
            $table->string('type',10)->comment('响应动作类型');
            $table->string('key')->default('')->comment('菜单KEY值 click等点击类型必须');
            $table->integer('keyword_id')->default(0)->comment('菜单KEY值 绑定关键词ID');
            $table->string('url')->default('')->comment('网页链接 view、miniprogram类型必须');
            $table->string('name')->comment('菜单标题');
            $table->string('media_id')->default('')->comment('永久素材');
            $table->string('appid')->default('')->comment('小程序的appid');
            $table->string('pagepath')->default('')->comment('小程序的页面路径');
            $table->tinyInteger('displayOrder')->default(0)->comment('是否关注 0=否 1=是');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('wechat_menu');
    }
}
